﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// NotReviewedButNeeded
#pragma once

#include "GcmpModelInterface.h"
#include "IObject.h"

namespace gcmp 
{
    
    class IElement;
    class CommandParameters;

    /// \brief Element命令行为数据
    ///
    class GCMP_MODEL_INTERFACE_EXPORT ICommandBehaviorData
    {
    public:
        virtual ~ICommandBehaviorData(){}

        ///  \brief 创建命令行为数据
        ///
        /// \return 命令行为数据
        static OwnerPtr<ICommandBehaviorData> Create();

        ///  \brief 设置命令Id
        ///
        /// \param  commandId  命令Id
        /// \return
        virtual void SetCommandId(const std::wstring &commandId) = 0;

        ///  \brief 获取命令Id
        ///
        /// \return 命令Id
        virtual const std::wstring& GetCommandId() const = 0;

        ///  \brief 设置命令参数
        ///
        /// \param  cmdParams  命令参数
        /// \return
        virtual void SetCommandParams(const gcmp::CommandParameters& cmdParams) = 0;

        ///  \brief 获取命令参数
        ///
        /// \return 命令参数
        virtual const gcmp::CommandParameters& GetCommandParams() const = 0;
    };

    /// \brief Element的命令行为
    ///
    class GCMP_MODEL_INTERFACE_EXPORT ICommandBehavior : public IObject
    {
        DEFINE_CAST_DERIVED(gcmp::ICommandBehavior, gcmp::IObject)
    public:
        ///  \brief 获取命令行为类型（鼠标双击，平台预定义）
        ///
        /// \return 鼠标双击类型
        static const std::wstring& GetDoubleClickCommandType();

        ///  \brief 获取命令行为类型（夹点编辑，平台预定义）
        ///
        /// \return 夹点编辑类型
        static const std::wstring& GetHandleCommandType();

        ///  \brief  设置命令行为类型和参数
        ///
        /// \param  commandBehaviortype 命令行为类型
        /// \param  opCommandBehaviorData 命令行为数据
        /// \return
        virtual void SetCommandBehaviorData(const std::wstring &commandBehaviortype,OwnerPtr<ICommandBehaviorData> opCommandBehaviorData) = 0;

        ///  \brief  根据命令行为类型获取参数
        ///
        /// \param  commandBehaviortype 命令行为类型
        /// \return 命令行为数据
        virtual const ICommandBehaviorData* GetCommandBehaviorData(const std::wstring &commandBehaviortype) const = 0;

    };
}// namespace gcmp


